# -- coding: utf-8 --
# @Time : 2021/3/14--20:43
# @Author : ChinaV
# @File : 简单应用题 2：就业人数统计.py

# -*- coding:utf-8 -*-
'''
This is a python123.io file.
'''
# 请在...上完善代码
names = input()
d = {}

for i in names.split(" "):
    if len(i) > 0:
        d[i] = d.get(i, 0) + 1

ls = list(d.items())
ls.sort(key=lambda x: x[1], reverse=True)  # 按照数量排序
for k in range(len(ls)):
    print("{}:{}".format(ls[k][0], ls[k][1]))
